//
//  CustomCountryNumView.swift
//  FrameProduct
//
//  Created by delegate on 2025/10/20.
//

import UIKit

class CustomCountryNumView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    private func setupUI() {
        addSubviews(bgView)
        bgView.addSubviews(countryLabel, countryNumLabel)
        bgView.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.bottom.equalToSuperview()
            make.left.equalTo(22)
            make.right.equalTo(-22)
        }
        countryLabel.snp.makeConstraints { make in
            make.left.equalTo(10)
            make.top.bottom.equalToSuperview()
        }
        countryNumLabel.snp.makeConstraints { make in
            make.left.equalTo(countryLabel.snp.right).offset(37)
            make.top.bottom.equalToSuperview()
        }
    }
    //=================================================================
    //                            lazy
    //=================================================================
    // MARK: - lazy
    private lazy var bgView: UIView = {
        let view = UIView()
        view.layer.cornerRadius = 10
        view.layer.masksToBounds = true
        view.backgroundColor = .lxs.hex("#152443")
        return view
    }()
    private lazy var countryLabel: UILabel = {
        let label = UILabel()
        label.text = "国家/地区";
        label.textColor = .lxs.hex("#FFFFFF")
        label.font = .lxs.font(size: 14)
        return label
    }()
    private lazy var countryNumLabel: UILabel = {
        let label = UILabel()
        label.text = "中国（+86）";
        label.textColor = .lxs.hex("#FFFFFF")
        label.font = .lxs.font(size: 14)
        return label
    }()
}
